import 'package:flutter/material.dart';
import 'package:flutter_mes_app/common/index.dart';
import 'package:get/get.dart';

class IcosItem {
  final String iconData;
  final String label;
  final List<Color> colors;

  IcosItem({
    required this.iconData,
    required this.label,
    required this.colors, // 颜色列表作为必填参数
  });
}

class DesktopController extends GetxController {
  final List<IcosItem> businessFunctionItems = [
    IcosItem(
      iconData: AssetsSvgs.mesRawMaterialProcessingSvg,
      label: LocaleKeys.desktopSlurryManagement.tr,
      colors: [const Color(0xFFB358DD), const Color(0xFFE597FB)],
    ),
    IcosItem(
      iconData: AssetsSvgs.mesTransferOrderSvg,
      label: LocaleKeys.desktopTransferOrder.tr,
      colors: [const Color(0xFF42A5F5), const Color(0xFFB4C7F3)],
    ),
    IcosItem(
      iconData: AssetsSvgs.mesSaleOrderSvg,
      label: LocaleKeys.desktopPurchaseRequest.tr,
      colors: [const Color(0xFF4E76EC), const Color(0xFF9BADE3)],
    ),
    IcosItem(
      iconData: AssetsSvgs.mesOutboundOrderSvg,
      label: LocaleKeys.desktopOutboundOrder.tr,
      colors: [const Color(0xFFFB796C), const Color(0xFFFD9D84)],
    ),
    IcosItem(
      iconData: AssetsSvgs.mesRawMaterialProcessingSvg,
      label: LocaleKeys.desktopInboundOrder.tr,
      colors: [const Color(0xFF15BD73), const Color(0xFF47E49F)],
    ),
    IcosItem(
      iconData: AssetsSvgs.mesInspectionMaintenanceWorkOrderSvg,
      label: LocaleKeys.desktopInspectionTask.tr,
      colors: [const Color(0xFFE4A921), const Color(0xFFFECD2C)],
    ),
  ];

  final List<IcosItem> warehouseManagementItems = [
    IcosItem(
      iconData: AssetsSvgs.mesRawMaterialProcessingSvg,
      label: LocaleKeys.desktopWeighing.tr,
      colors: [const Color(0xFF15BD73), const Color(0xFF47E49F)],
    ),
    IcosItem(
      iconData: AssetsSvgs.mesTransferOrderSvg,
      label: LocaleKeys.desktopPackingUnpacking.tr,
      colors: [const Color(0xFF42A5F5), const Color(0xFFB4C7F3)],
    ),
    IcosItem(
      iconData: AssetsSvgs.mesSaleOrderSvg,
      label: LocaleKeys.desktopPackagingList.tr,
      colors: [const Color(0xFFFB796C), const Color(0xFFFD9D84)],
    ),
  ];

  @override
  void onReady() {
    super.onReady();
    _initData();
  }

  void _initData() {
    update(["desktop"]);
  }

  void onTap(int index) {
    // 处理点击事件
    print('Tapped on item $index');
  }
}
